import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 洪汤泽大帅哥
 * Date: 2024-10-13
 * Time: 15:26
 */
public class TestDemo {
    public static void resever(int[] arr) {
        int i = 0;
        int j = arr.length - 1;
        while (i < j) {
            int temp = arr[i];
            arr[i]=arr[j];
            arr[j]=temp;
            i++;
            j--;
        }
    }

    public static void main(String[] args) {

        int[] array = {10, 20, 30, 40};
        System.out.println(Arrays.toString(array));

        resever(array);
        System.out.println(Arrays.toString(array));
    }
}
